package com.xinqi.modules.sys.util;

import java.net.URL;
import java.net.URLConnection;

public class FileUtils {

    /**
     * 计算文件大小
     * 最小单位（KB）
     */
    public static Integer clacFileSize(String path) {
        try {
            URL url = new URL(path);
            URLConnection connection = url.openConnection();
            return connection.getContentLength() / 1024;
        } catch (Exception e) {
            return 0;
        }

    }

}
